* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-image: url('images/赫连赫苍.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
/* 移除半透明遮罩层和模糊效果 */
/* 修改聊天容器布局，使其只显示在下半屏 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 60vh; /* 设置为视口高度的60%，可根据需要调整 */
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: transparent; /* 保持背景透明 */
}

/* 聊天头部样式调整 */
.chat-header {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transition: all 0.3s ease;
}

/* 消息区域样式调整 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: transparent;
    /* 确保新消息从底部显示 */
    display: flex;
    flex-direction: column;
    margin-top: 100px;
}

/* 输入区域样式保持不变 */
.chat-input {
    display: flex;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* 调整消息气泡的样式 */
.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .chat-container {
        height: 70vh; /* 在移动设备上可以适当增大高度 */
    }
    
    .message-content {
        max-width: 85%; /* 移动设备上消息宽度可以更大 */
    }
}
/* 简化的滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 10px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    /* 滚动条动画 */
    transition: all 0.3s ease;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}
.message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message.sent {
    justify-content: flex-end;
    /* 发送消息的进入动画 */
    animation: slideInRight 0.3s ease-out;
}
.message.received {
    justify-content: flex-start;
    /* 接收消息的进入动画 */
    animation: slideInLeft 0.3s ease-out;
}
/* 新增消息进入动画 */
@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(50px);
    }
    to { 
        opacity: 1; 
        transform: translateX(0);
    }
}
@keyframes slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-50px);
    }
    to { 
        opacity: 1; 
        transform: translateX(0);
    }
}
/* 黑色半透明聊天气泡 */
.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: bold;
    /* 添加气泡悬停效果 */
    transition: all 0.3s ease;
}
.message-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
/* 消息时间 */
.message-time {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
    font-weight: normal;
    /* 添加时间显示动画 */
    opacity: 0;
    animation: fadeInTime 0.3s ease-in 0.3s forwards;
}
@keyframes fadeInTime {
    to { opacity: 0.7; }
}
.message.received .message-time {
    text-align: left;
}
/* 输入区域 - 黑色半透明 */
.chat-input {
    display: flex;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    /* 添加输入区域动画 */
    transition: all 0.3s ease;
}
/* 输入框 - 黑色半透明 */
.input-field {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: bold;
    font-family: 'Microsoft YaHei', Arial, sans-serif; /* 添加字体设置，与body保持一致 */
    transition: all 0.3s ease;
}
.input-field:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: scale(1.01);
}
.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
}
/* 发送按钮 - 黑色半透明 */
.send-button {
    margin-left: 10px;
    padding: 12px 25px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Microsoft YaHei', Arial, sans-serif; /
}
.send-button:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.send-button:active:not(:disabled) {
    transform: scale(0.98);
}
.send-button:disabled {
    background-color: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}
/* 新增：打字机效果 */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 18px;
    color: white;
    font-weight: bold;
    width: fit-content;
}
.typing-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
/* 括号内容的样式 - 不太明显的灰色 */
.message-content p .bracket-content {
    color: rgba(255, 255, 255, 0.6); /* 不太明显的灰色 */
    font-weight: normal; /* 可以比正常文本轻一些 */
}

/* 括号本身保持原来的颜色 */
.message-content p {
    color: white;
    font-weight: bold;
}

/* 继续完成原来的文件内容 */

/* 语音按钮样式 - 黑色调优化版 */
.voice-button {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    /* 修改为更深的黑色背景 */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(4px);
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
}

/* 语音按钮悬停效果 */
.voice-button:hover {
    /* 悬停时略微变亮但仍然保持深色 */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    opacity: 1;
}

/* 语音按钮播放状态 */
.voice-button[data-playing="true"] {
    /* 播放状态使用深色背景配合强调色 */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(255, 105, 180, 0.3));
    animation: pulse 1.5s infinite;
}

/* 播放状态动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 105, 180, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 105, 180, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 105, 180, 0);
    }
}

/* 语音按钮禁用状态 */
.voice-button:disabled {
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* 确保消息内容有足够的内边距，防止被按钮遮挡 */
.message-content {
    padding-left: 30px !important;
    position: relative;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .voice-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
        top: -8px;
        left: -8px;
    }
    
    .message-content {
        padding-left: 25px !important;
    }
}

/* 设置按钮样式 */
.settings-button-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

.settings-button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.settings-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.settings-button:active {
    transform: scale(0.95);
}